import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
//数据请求
import axios from 'axios'
//ui框架
import Vant from 'vant'
//侧边导航
import { Sidebar, SidebarItem } from 'vant';
//Grid宫格
import { Grid, GridItem } from 'vant';
//弹出层
import { Popup } from 'vant';
//tab切换
import { Tab, Tabs } from 'vant';
//下拉
import { DropdownMenu, DropdownItem } from 'vant';
//粘性
import { Sticky } from 'vant';
//头部
import { NavBar } from 'vant';
//tap点击
import vueTap from 'v-tap'
//适配
import 'vant/lib/index.css'
import 'lib-flexible/flexible'
//分享
import Share from 'vue-social-share'
import 'vue-social-share/dist/client.css'
//进度条
import 'nprogress/nprogress.css'
//Scroller
import VueScroller from 'vue-scroller'

//测试数据
import './data/test'
//Lide测试数据


import  './assets/iconfont.css'

import Router from "vue-router"
const routerPush = Router.prototype.push
Router.prototype.push = function push(location) {
return routerPush.call(this, location).catch(error=> error)
}
Vue.config.productionTip = false

Vue.prototype.$axios = axios;
Vue.use(Vant);
Vue.use(vueTap);
Vue.use(Share);
Vue.use(VueScroller);
Vue.use(Sidebar);
Vue.use(SidebarItem);
Vue.use(Grid).use(GridItem);
Vue.use(Popup);
Vue.use(Tab).use(Tabs);
Vue.use(DropdownMenu).use(DropdownItem);
Vue.use(Sticky);
Vue.use(NavBar);


new Vue({
  router,
  store,
  render: function (h) { return h(App) }
}).$mount('#app')

router.beforeEach((to, from, next) => {
  /* 路由发生变化修改页面title */
  if (to.meta.title) {
    document.title = to.meta.title
  }
  next()
})